package pl.ncdc.web.login.server.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestHttpRequestAuthenticationServlet extends HttpServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		
		System.out.println(req.getContentType());
		
		String line;
		while((line = req.getReader().readLine()) != null)
		{
		  System.out.println(line);
		}
		
		resp.setStatus(200);
		resp.setContentType("text/plain");
		resp.getWriter().print("OK");
		
	}
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		System.out.println("Logout");
		resp.setStatus(200);
		resp.setContentType("text/plain");
		resp.getWriter().print("Logout");
	}
}
